(function() {
	Ext.onReady(function() {
		Ext.regModel("User", {
			fields: [
				{name: 'name', type:'string'}
				],
			proxy: {
				type:'localstorage',
				id: 'twitter-Searches'
			}
		});
		
		//利用store初始化数据
		var store = new Ext.data.Store({
			model:User
		});
		//浏览器没执行一次就会往cookie里存入一个记录
		store.add({name:'zhangsan'});
		store.sync();  //保存到浏览器的cookie里
		store.load();  //从cookie里加载数据出来
		var msg = [];
		store.each(function(rec) {
			msg.push(rec.get('name'));
		});
		alert(msg.join("\n"));
	});
})();